package com.wizinno.android.urineflow.data;

import lombok.Getter;

/**
 * 阀门状态
 *
 * @author LiuMei
 * @date 2020-12-14.
 */
@Getter
public enum ValveStatusEnum {
    UNKNOWN(0, "未知"),
    OPEN(1, "开"),
    CLOSE(2, "关"),
    ;
    private int code;
    private String desc;

    ValveStatusEnum(int i, String s) {
        this.code = i;
        this.desc = s;
    }

    public static String getDesc(int code) {
        ValveStatusEnum[] values = ValveStatusEnum.values();
        for (ValveStatusEnum value : values) {
            if (value.code == code) {
                return value.desc;
            }
        }
        return "未知";
    }
}
